package com.blank.task08;

public class PhoneCardTest {
    public static void main(String[] args) {
        //声明AbstractPackage类型的引用指向子类类型的对象，形成了多态
        AbstractPackage callPa = new CallPackage(18.0,20,10);
        callPa.showPackageInfo();
        //声明AbstractPackage类型的引用指向子类类型的对象，形成了多态
        AbstractPackage netPa = new NetPackage(28,300.0);
        netPa.showPackageInfo();
        //声明接口TalkService类型的引用指向实现类的对象实现了多态
        TalkService talkSe = new CallPackage();
        PhoneCard phoneCa = new PhoneCard();
        phoneCa.setUserName("Blank");

        //声明接口NetService类型的引用指向实现类的对象实现了多态
        NetService netSe = new NetPackage();
        netSe.NetShow(25.0,phoneCa);
        talkSe.talkShow(30,phoneCa);
        //使用枚举对象
        PhoneCard card = new PhoneCard(PhoneCardType.MICRO.getPhoneCardType(),12345,"Blank");
        card.cardShow();
        ConsumerInformation conInfo = new ConsumerInformation(25,340.50,58.9);
        conInfo.conInfoShow();

        //声明一个PhoneCard类型的引用指向PhoneCard类型的调用
        PhoneCard pc = new PhoneCard(PhoneCardType.BIG.getPhoneCardType(),123456, "white",234234, 28.6, 40, 505.0,conInfo);
        pc.showAll(callPa);
    }
}
